
package com.lungle.warmdiary.app.view.active;

import com.lungle.warmdiary.R;
import com.lungle.warmdiary.app.view.active.fragment.ActiveCommentFragment;
import com.lungle.warmdiary.app.view.active.fragment.ActiveDetailFragment;


public enum ActiveDetailTab {
    ACTIVE_REWARD(0, 0, R.string.frame_title_activi_detail, ActiveDetailFragment.class),
    PART_NUM(1, 1, R.string.frame_title_activi_self, ActiveCommentFragment.class);

    private Class<?> clz;
    private int idx;
    private int title;
    private int catalog;

    private ActiveDetailTab(int idx, int catalog, int title, Class<?> clz) {
        this.idx = idx;
        this.clz = clz;
        this.setCatalog(catalog);
        this.setTitle(title);
    }

    public static ActiveDetailTab getTabByIdx(int idx) {
        for (ActiveDetailTab t : values()) {
            if (t.getIdx() == idx)
                return t;
        }
        return ACTIVE_REWARD;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public int getCatalog() {
        return catalog;
    }

    public void setCatalog(int catalog) {
        this.catalog = catalog;
    }
}
